@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
  /* Customize these variable */
  /* https://github.com/adamwathan/tailwind-css-variable-text-opacity-demo */
  --tw-clr-primary-200: 219 255 0;
  --tw-clr-primary-300: 0 232 135;
  --tw-clr-primary-400: 0 224 243;
  --tw-clr-primary-500: 0 196 253;

  --clr-primary-200: rgb(var(--tw-clr-primary-200)); /* #DBFF00 */
  --clr-primary-300: rgb(var(--tw-clr-primary-300)); /* #00e887 */
  --clr-primary-400: rgb(var(--tw-clr-primary-400)); /* #00e0f3 */
  --clr-primary-500: rgb(var(--tw-clr-primary-500)); /* #00c4fd */
}

@layer base {
  /* inter var - latin */
  @font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: optional;
    src: url('/fonts/inter-var-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
      U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212,
      U+2215, U+FEFF, U+FFFD;
  }

  html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
  }

  @media (prefers-reduced-motion: reduce) {
    html {
      scroll-behavior: auto;
    }
  }

  ::selection {
    background: rgba(var(--tw-clr-primary-300) / 0.3);
  }

  .cursor-newtab {
    cursor: url('/images/new-tab.png') 10 10, pointer;
  }

  /* #region  /**=========== Default Typography =========== */
  h1,
  .h1 {
    @apply font-primary text-2xl font-bold md:text-4xl;
  }

  h2,
  .h2 {
    @apply font-primary text-xl font-bold md:text-3xl;
  }

  h3,
  .h3 {
    @apply font-primary text-lg font-bold md:text-2xl;
  }

  h4,
  .h4 {
    @apply font-primary text-base font-bold md:text-lg;
  }

  body,
  .body {
    @apply font-primary text-sm md:text-base;
  }
  /* #endregion  /**======== Default Typography =========== */

  .layout {
    max-width: 68rem;
    @apply mx-auto w-11/12;
  }

  .bg-dark a.custom-link {
    @apply border-gray-200 hover:border-gray-200/0;
  }

  .min-h-main {
    @apply min-h-[calc(100vh-82px)];
  }
  .accent {
    @apply dark:bg-gradient-to-tr dark:from-primary-300 dark:to-primary-400 dark:bg-clip-text dark:text-transparent;
  }

  .accent-highlight {
    @apply bg-primary-300/50 dark:bg-gradient-to-tr dark:from-primary-300 dark:to-primary-400 dark:bg-clip-text dark:text-transparent;
  }
}

@layer utilities {
  .animated-underline {
    background-image: linear-gradient(#33333300, #33333300),
      linear-gradient(to right, var(--clr-primary-300), var(--clr-primary-400));
    background-size: 100% 2px, 0 2px;
    background-position: 100% 100%, 0 100%;
    background-repeat: no-repeat;
    transition: 0.3s ease;
    transition-property: background-size, color, background-color, border-color;
  }
  @media (prefers-reduced-motion: reduce) {
    .animated-underline {
      transition: none;
    }
  }
  .animated-underline:hover,
  .animated-underline:focus-visible,
  .project-card:hover .animated-underline,
  .project-card:focus-visible .animated-underline {
    background-size: 0 2px, 100% 2px;
  }

  /* #region  /**=========== Animate Shadow =========== */
  .animate-shadow {
    @apply after:absolute after:inset-0 after:z-[-1] after:opacity-0 after:transition-opacity hover:after:opacity-100;
    @apply after:shadow-md dark:after:shadow-none;
  }
  /* #endregion  /**======== Animate Shadow =========== */

  /* #region  /**=========== Fade In =========== */
  [data-fade] {
    @apply translate-y-10 opacity-0 transition duration-300 ease-out motion-reduce:translate-y-0 motion-reduce:opacity-100;
  }
  .fade-in-start [data-fade] {
    @apply translate-y-0 opacity-100;
  }
  .fade-in-start [data-fade='1'] {
    transition-delay: 100ms;
  }
  .fade-in-start [data-fade='2'] {
    transition-delay: 200ms;
  }
  .fade-in-start [data-fade='3'] {
    transition-delay: 300ms;
  }
  .fade-in-start [data-fade='4'] {
    transition-delay: 400ms;
  }
  .fade-in-start [data-fade='5'] {
    transition-delay: 500ms;
  }
  .fade-in-start [data-fade='6'] {
    transition-delay: 600ms;
  }
  .fade-in-start [data-fade='7'] {
    transition-delay: 700ms;
  }
  .fade-in-start [data-fade='8'] {
    transition-delay: 800ms;
  }
  .fade-in-start [data-fade='9'] {
    transition-delay: 900ms;
  }
  /* #endregion  /**======== Fade In =========== */
}
/* Tippy */
.tippy-tooltip [x-circle] {
  background-color: transparent !important;
}

.tippy-tooltip {
  padding: 0 0.8rem;
}

/* YT Lite */
.yt-lite::before {
  content: none !important;
}

/* #region  /**=========== Twitter Embed =========== */
.twitter-tweet.twitter-tweet-rendered {
  margin: 0 auto !important;
  border-radius: 12px;
  overflow: hidden;
}
.tweet-custom-border {
  @apply rounded-xl border-r border-gray-300 dark:border-gray-700;
}
@media (min-width: 595px) {
  .tweet-custom-border {
    @apply !border-0;
  }
}
/* #endregion  /**======== Twitter Embed =========== */

/* #region /**=========== Like Button Animation =========== */
.heart-animate {
  transition: transform 80ms cubic-bezier(0.64, 0.57, 0.67, 1.53);
  transform: scale(1);
}

.heart-animate:hover,
.heart-animate:focus,
.heart-button:hover .heart-animate,
.heart-button:focus-visible .heart-animate {
  transform: scale(1.15);
}

.heart-button:focus-visible .heart-animate {
  @apply rounded-sm focus:outline-none focus-visible:ring focus-visible:ring-primary-300;
}

.heart-animate:active,
.heart-button:active .heart-animate {
  transform: scale(1.3);
}

/* keyframe from opacity 0, to opacity 1, at last opacity 0 */
@keyframes emoji-animation {
  0% {
    transform: translateY(0);
    opacity: 0;
  }

  80% {
    transform: translateY(-40px);
    opacity: 1;
  }

  100% {
    transform: translateY(-40px);
    opacity: 0;
  }
}

.emoji-animate {
  animation: emoji-animation 0.7s cubic-bezier(0.33, 1, 0.68, 1);
}
/* #endregion /**======== Like Button Animation =========== */
